<%-- 
    Document   : ModifySponsoredEvent
    Created on : 30-giu-2011, 15.50.01
    Author     : Stefano
--%>

<%@page import="java.text.SimpleDateFormat"%>
<%@page import="java.text.DateFormat"%>
<%@page import="java.util.Date"%>
<%@page import="ejb.SponsoredEvent"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <%@ include file="/style/styles.html" %>
        <%@ include file="/js/libraries.html" %>
        <title>JSP Page</title>
    </head>
    <body onload="init()">
         <div id="wrapper">
        <%@ include file="/header.jsp" %>
        <h1>MODIFICA EVENTO SPONSORIZZATO</h1>
        </div>
    </body>
    <%
    SponsoredEvent sevent = new SponsoredEvent();
    String tags, sd, ed;
    int maximpression;
    Date start_date = null, end_date = null;
    
    sevent = (SponsoredEvent)request.getAttribute("sevent");
    
    maximpression = sevent.getMaxImpression();
    tags = sevent.getTag();
    start_date= sevent.getStartDate();
    end_date = sevent.getEndDate();
    
    DateFormat df = new SimpleDateFormat("dd/MM/yy");
    df.setLenient(false);

    sd = df.format(start_date);
    ed = df.format(end_date);

    
    %>
    <h2>L'evento che vuoi modificare è:</h2>
    <br>
    <hr>
    Nome: <%=sevent.getName()%>
    <br>
    Eid: <%=sevent.getEid()%>
    <br><br>
    <form onSubmit="return checkForm();" name="eventList" action= "/delo-war/IMDSponsoredEvent.jsp">
        <div id="form-sponsor-date">
            <label>Da</label><input size="10" type="text" class="datepicker" id="data-from" name="data-from" value="<%=sd%>"/>
            <label>A</label><input size="10" type="text" class="datepicker" id="data-to" name="data-to" value="<%=ed%>"/>
        </div>
        <div>
            <lable>Max Impressions</lable><input id="max-imp" name="max-imp" value="<%=maximpression%>" type="text" size="10" />
        </div>
        <div><label>Tags</label><input type="text" id="tags-form" name="tags-form" value="<%=tags%>" style="width: 250px;"/></div>
        <input type="hidden" name="action" value="modifyInsert">
        <input type="hidden" name="eid" value="<%=sevent.getEid()%>">
        <input type="hidden" name="name" value="<%=sevent.getName()%>">    
        <input type="submit" name="Modifica" value ="Modifica"/>
    </form>
    <hr>

</html>
